package com.netistate.dao;

import java.util.List;


import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.netistate.base.BaseDao;
import com.netistate.pojo.Sale;

@Repository
public class SaleDao extends BaseDao<Sale, Integer>{

	/**
	 * 去查找此项目下的所有销售表
	 * @param pid
	 * @return List<Sale>
	 */
	@SuppressWarnings("unchecked")
	public List<Sale> findAllSaleByPid(int pid) {
		
		String hql = "from Sale where projectid = ?";
		Query query = getSession().createQuery(hql);
		query.setParameter(0, pid);
		return query.list();
	}

}
